home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19950528-19950726
/
000388_news@columbia.edu_Tue Jul 18 13:19:38 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-07-31
|
2KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA01811
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Tue, 18 Jul 1995 13:51:17 -0400
Received: by apakabar.cc.columbia.edu id AA17822
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Tue, 18 Jul 1995 13:51:14 -0400
Path: news.columbia.edu!panix!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!howland.reston.ans.net!news1.digex.net!news3.digex.net!digex.net!not-for-mail
From: hashmi@cnj.digex.net (Atiqullah Hashmi)
Newsgroups: comp.protocols.kermit.misc
Subject: dialing program; modem receives dial string but doesn't dialout ?
Date: 18 Jul 1995 09:19:38 -0400
Organization: Express Access Online Communications, New Jersey, USA
Lines: 40
Message-Id: <3ugcda$6uk@cnj.digex.net>
Nntp-Posting-Host: cnj.digex.net
Apparently-To: kermit.misc@watsun.cc.columbia.edu
Hi,
I have a simple program to dial out via a hayes modem. When run, the
modem RD and TD lights blink showing that it receives the dial string
from the program but doesn't really dial out.
Here is the relevant piece of code. Any help is appreciated.
Thanks
Atiq
-------------------------------------
void sttyModem(int fd)
{
struct termio tbuf;
if (ioctl(fd, TCGETA, &tbuf) < 0 )
cerr << "ioctl(TCGETA) failed; errno = "<< errno << endl;
tbuf.c_iflag = IXON | IXOFF | ISTRIP | IGNBRK | IGNPAR;
tbuf.c_oflag = 0;
tbuf.c_lflag = 0;
tbuf.c_cflag = B300 | CS7 | CREAD | HUPCL | PARENB;
tbuf.c_cc[4] = 1; // MIN
tbuf.c_cc[5] = 0; // TIME
if (ioctl(fd, TCSETAF, &tbuf))
cerr << "ioctl(TCSETAF) failed; errno = "<< errno << endl;
}
main()
{
int tty_fd;
tty_fd=open(....) etc.
sttyModem(tty_fd);
char *str="ATDT91(800)222-3333\r"; //some number
char ss[10];
write(tty_fd, str, strlen(str));
read(tty_fd, ss, 1);
// other code..........
exit(0);
}